<div id="msg">
<form method="post" action="%%GLOBAL_FormAction%%" onsubmit="return CheckForm(this);">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
	<th colspan="2"><h3>%%LNG_kbLoginRequired%%</h3></th>
</tr>
<tr>
	<td colspan="2" style="color: red;">
		%%Panel.FrontendLoginError%%
	</td>
</tr>
<tr>
	<td align="right">%%LNG_Username%%:</td>
	<td>
		<input type="text" id="frontendUser" name="frontendUser" value="" />
	</td>
</tr>
<tr>
	<td align="right">%%LNG_Password%%:</td>
	<td>
		<input type="password" id="frontendPass" name="frontendPass" value="" />
	</td>
</tr>
<tr>
	<td>
	</td>
	<td>
		<input type="checkbox" name="frontendRemember" value="1" />
		%%LNG_RememberMyLoginDetails%%
	</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td>
		<input type="submit" value="Login" class="button" />
	</td>
</tr>
<tr class="footer">
	<td colspan="2">&nbsp;</td>
</tr>
</table>
</form>
</div>

<script type="text/javascript" language="javascript">

	function CenterForm()
	{
		var width=0;
		var height=0;
		if (typeof( window.innerWidth ) == 'number') {
			// Anything but IE
			width = window.innerWidth;
			height = window.innerHeight;
		} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
			// IE4 compatible
			width = document.body.clientWidth;
			height = document.body.clientHeight;
		}
		var left = 0;
		var top = 0;
		if ((width / 2 - 200) > 10) {
			left = width / 2 - 200;
		} else {
			left = 10;
		}

		if ((height / 2 - 200) > 10) {
			top = height / 2 - 200;
		} else {
			top = 10;
		}

		document.getElementById("msg").style.position = "absolute";
		document.getElementById("msg").style.left = left;
		document.getElementById("msg").style.top = top;
	}

	window.onresize = function() {
		CenterForm();
	}

	window.onload = function() {
		CenterForm();
	}

	function CheckForm(f)
	{
		if (document.getElementById('frontendUser').value == '') {
			alert('%%LNG_noUser%%');
			document.getElementById('frontendUser').focus();
			return false;
		}

		if (document.getElementById('frontendPass').value == '') {
			alert('%%LNG_noPass%%');
			document.getElementById('frontendPass').focus();
			return false;
		}

		return true;
	}

</script>
